package com.yunlong.exception;

import com.yunlong.enums.UserErrorCodeEnum;
import com.yunlong.common.exception.SysException;

/**
 * @author guorui
 * @date 2020-07-30 17:28
 */
public class UserException extends SysException {
    protected int code;
    public UserException(){}
    public UserException(String message){super(message);}
    //Object ...args java某个版本的新特性
    public UserException(UserErrorCodeEnum codeEnum,Object... args){
        super(String.format(codeEnum.getMessage(), args));
        this.code = codeEnum.getCode();
    }
}
